package com.beasts.antpage.core.common.dto;

import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 后台返回的前端请求数据的传输对象
 *
 * @author Locker
 * @date 25/06/2018 10:34 AM
 * @since 1.0
 */
@Data
@NoArgsConstructor
public class AjaxDTO<T> {

    /**
     * 返回信息
     */
    private String message;

    /**
     * 泛型字段，可 set 多种类型数据
     */
    private T data;

    public AjaxDTO(T data) {
        super();
        this.data = data;
    }

    public AjaxDTO(T data, String message) {
        super();
        this.data = data;
        this.message = message;
    }

    public AjaxDTO(Throwable e) {
        super();
        this.message = e.getMessage();
    }

}
